<!doctype html>
<html lang="en">

	<head>
		<meta charset="UTF-8" />
		<title>登录</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="css/login.css" />
	</head>

	<body>

		<header class="mui-bar mui-bar-nav">
			<a href="javascript:history.go(-1)" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">雷猫登录</h1>
		</header>
		
		<div class="mui-content id">
			<div class="logo">
			<img src="img/logo1.png" alt="logo" />
		</div>
			<form class="mui-input-group">
				<div class="mui-input-row">
					<input type="text" class="mui-input-clear" id="phone" placeholder="请输入手机号">
				</div>
				<div class="mui-input-row">
					<input type="password" class="mui-input-password" id="pwd" placeholder="请输入密码">
				</div>
				<div class="mui-button-row">
					<button type="button" class="mui-btn mui-btn-primary btn">登录</button>
				</div>
			</form>
			<div class="alearfix">
				<a href="register.html" class="register">免费注册</a>
				<a href="retrieve.html" class="forget_pwd">忘记密码</a>
			</div>
		</div>

<script src="js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		
		<script type="text/javascript">
			mui.init()
			$('.btn').click(()=>{
				var [check,phone,pwd] = [true,$('#phone').val(),$('#pwd').val()]
	        	var pattern = /^1[0-9]{10}$/;
				if(!pattern.test(phone) && phone == ''){
					mui.toast('请输入正确格式的手机号')
					check = false
					return false
				}
				if(pwd == ''){
					mui.toast('请输入密码')
					check = false
					return false
				}
				var patrn = /^(\w){6,20}$/
				if(!patrn.test(pwd)){
			    	mui.toast('密码只能输入6-20个字母、数字、下划线 ');	
					check = false
					return false
				}
				if(check){
					$('form').submit()
				}
			})
		</script>
	</body>

</html>